package com.lfy.conf;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * <p>
 *  
 * </p>
 *       
 * @author 吕飞扬
 * @data 2022/8/11 16:51
 * @params 
 * @return        
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {


    /**
     * <p>
     *  跨域问题前端已解决
     * </p>
     *
     * @author 吕飞扬
     * @data 2022/8/11 19:09
     * @params
     * @return
     */

@Override
public void addCorsMappings(CorsRegistry registry) {
    registry.addMapping("/**")
            .allowedOrigins("*")
            .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
            .allowCredentials(true)
            .maxAge(3600)
            .allowedHeaders("*")
            .exposedHeaders("*");
}

}
